package com.inspur.his.controller;

import com.inspur.his.pojo.DoctState;
import com.inspur.his.pojo.UserExt;
import com.inspur.his.service.DoctService;
import com.inspur.his.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/*这里是用户主界面计数，传入每个用户数量用于显示*/
@Controller
public class UserStateController {
    @Autowired
    private UserService userService;
    @Autowired
    private DoctService doctService;

    @RequestMapping("userState")
    @ResponseBody
    public Map<String,Object> userState(){
     Map<String,Object> map = new HashMap<String,Object>();
     //不同角色用户统计
      List<UserExt> userList =  userService.getUserByRole();
      map.put("user",userList);
      List<DoctState> doctList =doctService.getDoctByPst();
      map.put("doctors",doctList);
     return  map;
    }


}
